package com.ruoyi.common.entity.TransactionEntity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.entity.CoreEntity.Members;
import com.ruoyi.common.entity.CoreEntity.store.StoreInfo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 订单表对象 shop_order
 * 
 * @author swy
 * @date 2025-08-07
 */
public class ShopOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    private Members members;
    private StoreInfo storeInfo;

    public Members getMembers() { return members; }
    public void setMembers(Members members) { this.members = members; }

    private CouponInfo couponInfo;

    private List<ShopOrderItem> items; // 订单商品列表


    public CouponInfo getCouponInfo() {
        return couponInfo;
    }
    public void setCouponInfo(CouponInfo couponInfo) {
        this.couponInfo = couponInfo;
    }
    public StoreInfo getStoreInfo() { return storeInfo; }
    public void setStoreInfo(StoreInfo storeInfo) { this.storeInfo = storeInfo; }
    /** 订单ID，主键自增 */
    private Integer id;

    /** 订单编号，唯一 */
    @Excel(name = "订单编号，唯一")
    private String orderNo;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Integer membersId;

    /** 门店ID（下单门店） */
    @Excel(name = "门店ID", readConverterExp = "下=单门店")
    private Integer storeId;

    /** 收货地址信息（配送上门时使用） */
    @Excel(name = "收货地址信息", readConverterExp = "配=送上门时使用")
    private String address;

    /** 使用的优惠券ID */
    @Excel(name = "使用的优惠券ID")
    private Integer couponId;

    /** 商品总金额 */
    @Excel(name = "商品总金额")
    private BigDecimal itemsAmount;

    /** 平台活动优惠金额 */
    @Excel(name = "平台活动优惠金额")
    private BigDecimal discountAmount;

    /** 优惠券减免金额 */
    @Excel(name = "优惠券减免金额")
    private BigDecimal couponAmount;

    /** 运费 */
    @Excel(name = "运费")
    private BigDecimal shippingFee;

    /** 应付款总金额 */
    @Excel(name = "应付款总金额")
    private BigDecimal totalAmount;

    /** 订单状态（0-待付款 1-待发货 2-待收货 3-已完成 4-已取消 5-已退款） */
    @Excel(name = "订单状态", readConverterExp = "0=-待付款,1=-待发货,2=-待收货,3=-已完成,4=-已取消,5=-已退款")
    private Integer status;

    /** 支付方式（1-支付宝 2-微信 3-银行卡） */
    @Excel(name = "支付方式", readConverterExp = "1=-支付宝,2=-微信,3=-银行卡")
    private Integer paymentType;

    /** 付款时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "付款时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date paymentTime;

    /** 期望送达时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "期望送达时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expectDeliveryTime;

    /** 实际送达时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际送达时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date actualDeliveryTime;

    /** 订单备注 */
    @Excel(name = "订单备注")
    private String notes;

    /** 逻辑删除（0未删除，1已删除） */
    private String delFlag;

    /** 配送方式（1-门店自提，2-配送上门） */
    @Excel(name = "配送方式", readConverterExp = "1=-门店自提，2-配送上门")
    private Integer deliveryMethod;

    /** 自提码，用于核销取货 */
    @Excel(name = "自提码，用于核销取货")
    private String pickupCode;

    /** 自提状态（0-待提货，1-已提货） */
    @Excel(name = "自提状态", readConverterExp = "0=-待提货，1-已提货")
    private Integer pickupStatus;

    /** 实际提货时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际提货时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date pickupTime;

    /** 自提备注信息 */
    @Excel(name = "自提备注信息")
    private String pickupNotes;

    public void setId(Integer id) 
    {
        this.id = id;
    }

    public Integer getId() 
    {
        return id;
    }

    public void setOrderNo(String orderNo) 
    {
        this.orderNo = orderNo;
    }

    public String getOrderNo() 
    {
        return orderNo;
    }

    public void setMembersId(Integer membersId) 
    {
        this.membersId = membersId;
    }

    public Integer getMembersId() 
    {
        return membersId;
    }

    public void setStoreId(Integer storeId) 
    {
        this.storeId = storeId;
    }

    public Integer getStoreId() 
    {
        return storeId;
    }

    public void setAddress(String address) 
    {
        this.address = address;
    }

    public String getAddress() 
    {
        return address;
    }

    public void setCouponId(Integer couponId) 
    {
        this.couponId = couponId;
    }

    public Integer getCouponId() 
    {
        return couponId;
    }

    public void setItemsAmount(BigDecimal itemsAmount) 
    {
        this.itemsAmount = itemsAmount;
    }

    public BigDecimal getItemsAmount() 
    {
        return itemsAmount;
    }

    public void setDiscountAmount(BigDecimal discountAmount) 
    {
        this.discountAmount = discountAmount;
    }

    public BigDecimal getDiscountAmount() 
    {
        return discountAmount;
    }

    public void setCouponAmount(BigDecimal couponAmount) 
    {
        this.couponAmount = couponAmount;
    }

    public BigDecimal getCouponAmount() 
    {
        return couponAmount;
    }

    public void setShippingFee(BigDecimal shippingFee) 
    {
        this.shippingFee = shippingFee;
    }

    public BigDecimal getShippingFee() 
    {
        return shippingFee;
    }

    public void setTotalAmount(BigDecimal totalAmount) 
    {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getTotalAmount() 
    {
        return totalAmount;
    }

    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }

    public void setPaymentType(Integer paymentType) 
    {
        this.paymentType = paymentType;
    }

    public Integer getPaymentType() 
    {
        return paymentType;
    }

    public void setPaymentTime(Date paymentTime) 
    {
        this.paymentTime = paymentTime;
    }

    public Date getPaymentTime() 
    {
        return paymentTime;
    }

    public void setExpectDeliveryTime(Date expectDeliveryTime) 
    {
        this.expectDeliveryTime = expectDeliveryTime;
    }

    public Date getExpectDeliveryTime() 
    {
        return expectDeliveryTime;
    }

    public void setActualDeliveryTime(Date actualDeliveryTime) 
    {
        this.actualDeliveryTime = actualDeliveryTime;
    }

    public Date getActualDeliveryTime() 
    {
        return actualDeliveryTime;
    }

    public void setNotes(String notes) 
    {
        this.notes = notes;
    }

    public String getNotes() 
    {
        return notes;
    }

    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    public void setDeliveryMethod(Integer deliveryMethod) 
    {
        this.deliveryMethod = deliveryMethod;
    }

    public Integer getDeliveryMethod() 
    {
        return deliveryMethod;
    }

    public void setPickupCode(String pickupCode) 
    {
        this.pickupCode = pickupCode;
    }

    public String getPickupCode() 
    {
        return pickupCode;
    }

    public void setPickupStatus(Integer pickupStatus) 
    {
        this.pickupStatus = pickupStatus;
    }

    public Integer getPickupStatus() 
    {
        return pickupStatus;
    }

    public void setPickupTime(Date pickupTime) 
    {
        this.pickupTime = pickupTime;
    }

    public Date getPickupTime() 
    {
        return pickupTime;
    }

    public void setPickupNotes(String pickupNotes) 
    {
        this.pickupNotes = pickupNotes;
    }

    public String getPickupNotes() 
    {
        return pickupNotes;
    }

    public List<ShopOrderItem> getItems() {
        return items;
    }

    public void setItems(List<ShopOrderItem> items) {
        this.items = items;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("orderNo", getOrderNo())
            .append("membersId", getMembersId())
            .append("storeId", getStoreId())
            .append("address", getAddress())
            .append("couponId", getCouponId())
            .append("itemsAmount", getItemsAmount())
            .append("discountAmount", getDiscountAmount())
            .append("couponAmount", getCouponAmount())
            .append("shippingFee", getShippingFee())
            .append("totalAmount", getTotalAmount())
            .append("status", getStatus())
            .append("paymentType", getPaymentType())
            .append("paymentTime", getPaymentTime())
            .append("expectDeliveryTime", getExpectDeliveryTime())
            .append("actualDeliveryTime", getActualDeliveryTime())
            .append("notes", getNotes())
            .append("delFlag", getDelFlag())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("deliveryMethod", getDeliveryMethod())
            .append("pickupCode", getPickupCode())
            .append("pickupStatus", getPickupStatus())
            .append("pickupTime", getPickupTime())
            .append("pickupNotes", getPickupNotes())
            .toString();
    }
}
